package cryptology1

import (
	"crypto/cipher"
	"crypto/aes"
)
/**
aes加密,解密一样的
 */
func AESenCrypto(srcText, key []byte) []byte {
	//创建des对象
	block, err := aes.NewCipher(key)
	if err != nil {
		panic(err)
	}
	iv := []byte("12345678ABCDEFGH")
	//分组模式
	stream:= cipher.NewCTR(block,iv)

	stream.XORKeyStream(srcText,srcText)
	return srcText
}

